package com.snj.bestdealer.lib;

import android.app.ProgressDialog;
import android.content.Context;
import android.util.Log;

public class CustomProgressDialog {
	private static ProgressDialog progressDlg = null;
	
	public static void show(Context context) {
		if(progressDlg==null) {
			try {
			progressDlg = ProgressDialog.show(
					context, 
					"", 
					"Please wait..", 
					true);
			progressDlg.setCancelable(true);
			}catch(Exception e) {
				Log.d("CustomProgressDialog", e.getMessage());
			}
		}
	}
	
	public static void dismiss() {
		if(progressDlg!=null) {
			try {
				progressDlg.dismiss();
			}catch(Exception e) {
				Log.d("CustomProgressDialog", e.getMessage());
			}finally{
				progressDlg = null;
			}
		}
	}
}
